var reverseBetween =function(head,m,n){
  let pre = null;
  let current = head;
  for(let i = 1 ; i < m;i++){
    pre = current;
    current = current.next
  }
  let pre2 = pre;
  let current2 = current2;
  for(let i= m;i<=n;i++){
    [current.next , pre , current] = [ pre,current,current.next];
  }
  if(pre2 !== null){
    pre2.next = pre
  }else{
    head = pre
  }
  current2.next = current;
  return head;
}